import request from '@/utils/request'


// 查询线索简介
export function listClue(query) {
  return request({
    url: '/tienchin/clue/list',
    method: 'get',
    params:query
  })
}
// 查询所有渠道
export function listChannel(query) {
  return request({
    url: '/tienchin/clue/channels',
    method: 'get'
  })
}
export function getUsersByDeptId(deptId){
  return request({
    url:'/tienchin/clue/users/' + deptId,
    method:'get'
  })
}

// 根据渠道id，查询活动
export function listActivityByChannelId(channelId) {
  return request({
    url: '/tienchin/clue/activity/' + channelId,
    method: 'get'
  })
}
// 查询线索列表
export function getClueById(clueId) {
  return request({
    url: '/tienchin/clue/' + clueId,
    method: 'get'
  })
}

// 新增线索
export function addClue(data) {
  return request({
    url: '/tienchin/clue',
    method: 'post',
    data: data
  })
}
export function clueFollow(data){
  return request({
    url: '/tienchin/clue/follow',
    method: 'post',
    data: data
  })
}
export function assignClue(data) {
  return request({
    url: '/tienchin/clue/assignment',
    method: 'post',
    data: data
  })
}
// 查询线索的跟进记录
export function getClueRecordByClueId(clueId) {
  return request({
    url: '/tienchin/follow/record/clue/' + clueId,
    method: 'get'
  })
}
export function getClueSummaryById(clueId) {
  return request({
    url: '/tienchin/clue/summary/' + clueId,
    method: 'get'
  })
}
// 线索转为商机
export function clue2Business(clueId) {
  return request({
    url: '/tienchin/clue/toBusiness/'+clueId,
    method: 'post'
  })
}

export function invalidClue(data) {
  return request({
    url: '/tienchin/clue/invalid',
    method: 'post',
    data: data
  })
}


// 修改角色
export function updateClue(data) {
  return request({
    url: '/tienchin/clue',
    method: 'put',
    data: data
  })
}

// 删除角色
export function delClue(clueIds) {
  return request({
    url: '/tienchin/clue/' + clueIds,
    method: 'delete'
  })
}









